var windowName = "selectStyle";
$(function () {
    var OrderList = new List();
    var Page = createVM("#Page", {
        //页面数据
        id: 0
        , text: ""
        , num: ""
        , orderNum: ""
        , name: ""
        , phone: ""
        , paperName: ""
        , backName: ""
        , title: ""
        // , backName: ""
        // , backName: ""
    }, {
        //页面方法

        /**
         * 生命周期函数--监听页面加载
         */
        onLoad: function (options) {
            let id = getUrlData("id");
            this.id = id
            // getOrderInfo(this)
            getData(this)
            getOrderInfo(this)
        },
        selectPaper: function (e) {

            let id = this.id
            goto("/pic/Page/Wap/selectPaper.html?id=" + id)
        },
        goback: function (e) {

            let id = this.id
            goto("/pic/Page/Wap/index.html")
        },
        next: function (e) {
            let id = this.id

            apiPost("/po/order/create/3", { id }, function (res) {
                console.log(res)
                // wx.redirectTo({
                //     url: '/pages/end/end',
                // })
                goto("/pic/Page/Wap/end.html?id=" + id)
            })
        },

    })


    Page.onLoad()

})


function getData(_this) {
    let id = _this.id
    apiGet("/po/config", {id}, function (res) {
        console.log(res)
        let text = res.d.text
        _this.setData({text})
    })
}

function getOrderInfo(_this) {
    let id = _this.id
    apiGet("/po/order/create/98", { id }, function (res) {
        let num_total = res.d.num
        let picW = res.d.picw
        let picH = res.d.pich
        let orderTitle = res.d.title
        _this.setData(res.d)
        // _this.setData({ backPic })
    })
}